package com.cf.faq;


import com.cf.faq.controller.FaqFrontController;
import com.cf.faq.model.FaqService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * boot-message-WebMessageConfig
 *
 * @author <a href="2428922347@qq.com">Zhu mingming</a>
 * @info
 * @since 2018/7/12 下午 03:07
 */
@Slf4j
@Configuration
@EnableConfigurationProperties(FaqProperty.class)
public class FaqConfig {

    @Bean
    public FaqService faqService() {
        log.info("实例化FaqService");
        return new FaqService();
    }

    @Bean
    @ConditionalOnProperty(value = "zmm.faq.front", havingValue = "true")
    public FaqFrontController faqFrontController() {
        log.info("实例化FaqFrontController");
        return new FaqFrontController();
    }


}
